package day05test;

import java.util.Random;
import java.util.Scanner;

public class Addition {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Random r = new Random();
        int count = 0;
        for (int i = 0; i < 10; i++) {
            int num = r.nextInt(100)+1;
            int num1 = r.nextInt(100)+1;
            System.out.println(num+ "+" +num1+ "=?");
            int userNum = sc.nextInt();
            int sum = num +num1;
            if(sum == userNum){
                System.out.println("回答正确");
                count+=10;
            }else {
                System.out.println("回答错误,下一题");
            }


        }
        System.out.println("最终得分是"+ count+"分");
    }
}
